var windowName = "search";
var Page
apiready = function(){
    Page = createVM("#Page",{
        //页面数据
        keyword: ''
        ,myWords: []
        ,hotWords: []
        ,shop:[]
        ,product:[]
        ,showList:false
        ,curTab: 0
        ,listLoading:false
        ,my:[]
        ,isHot:[]
    },{
        //页面方法
        "init":function () {
            apiGet("/app/search/keys",{},function (res,code) {
                logJson(res);
                Page.my = res.data.my;
                Page.isHot = res.data.isHot;
            })
        }
        , doSearch: function () {
            showLoading()
            apiGet("/app/search",{keywords:this.keyword},function (res,code) {
                logJson(res);
                clearLoading();
                Page.shop = res.data.shop;
                Page.product = res.data.product;
                Page.showList = true;
            })
        }
        ,tab:function (index) {
            log(index)
            // Page.listLoading = true;
            setTimeout(function () {
                // Page.listLoading = false;
            },3000)
        }
    })
    Page.init()
}
